<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script src='../vue.global.js'></script>
</head>

<body>
    <div id='app'>

        <!-- 双分支 -->
        <h3 v-if="vueIsGood">Vue棒极了</h3>
        <h4 v-else>Vue还有待完善</h4>
        <hr>

        <!-- 单分支 -->
        <!-- template这层标签不会渲染（幽灵标签） 代表内涵的DOM结构作为一个渲染的整体 -->
        <template v-if="hasPublished">
            <h1>Title</h1>
            <p>Paragraph 1</p>
            <p>Paragraph 2</p>
        </template>
        <hr>

        <!-- 多分支 -->
        <div v-if="age >= 60">
           <h3>颐养天年</h3>
        </div>

        <div v-else-if="age >= 18">
           <h3>龙精虎猛</h3>
        </div>

        <div v-else-if="age >= 5">
           <h3>一只小屁孩</h3>
        </div>

        <div v-else>
           <h3>乳臭未干</h3>
        </div>

    </div>

    <script>
        const app = Vue.createApp({
            data() {
                return {
                    vueIsGood:123,

                    // 文章已发表
                    hasPublished: 123,

                    age:3,
                }
            }
        })
        const vm = app.mount('#app')
    </script>
</body>

</html>